

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>  
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="js/jquery-1.6.js">
</script>
<script type="text/javascript" >
	$(document).ready(function() {
		$('#form').submit(function() {
			var password = $('#password').val();
			var confirmNewPass = $('#confirmNewPass').val();
			
			if(password == '' || password == ' ' || confirmNewPass == '' || confirmNewPass == ' ') {
				alert("Required Field(s) Empty");
				return false;
			}
			else if(password != confirmNewPass) {
				alert("Passwords don't Match !");
				$('#form').each(function() {
					this.reset();
				});
				return false;
			}else {
				alert("Password Changed Successfully !");
			}
			
			});

		});
	
</script>
</head>
<body>

<form:form id="form" action="ConfirmChangePass.html"  commandName="changePass">
	<center>
	<table>
		
		<tr>
			<td>New Password :</td>
			<td><form:password id="password" path="password" /></td>
			
		</tr>
		<tr>
			<td>Confirm New Password :</td>
			<td><input type="password" id="confirmNewPass" /></td>
			
		</tr>
		<tr>
			<td colspan="2"><input type="submit" value="Change Password"></td>
		</tr>
		
	</table>
	</center>
	
</form:form>

</body>
</html>